In various control applications and for the present invention, a mathematical model refers to a set of mathematical equations relating dependent variables and independent variables. That is, those equations define explicitly or implicitly a set of dependent variables as functions, in the mathematical sense, of independent variables. The equations of a model can either be differential (the derivative of at least one dependent variable with respect to an independent variable appears in the equation) or algebraic (no derivative appears in the equation), and for the present invention at least one of the model equations is differential. The number of model equations is always equal to the number of dependent variables. Those equations can involve numerical quantities referred to as parameters which do not depend on any of the model variables, and whose values lie between fixed upper and lower bounds. In addition, the model equations include functions of the independent variables referred to as input sources, whose values can be arbitrarily controlled and defined. A model description therefore consists of a list of differential and algebraic equations together with a list of dependent and independent variables, the values and bounds of the parameters, and the definition of the input sources in terms of the independent variables. The purpose of a model numerical solver software is to perform the computational tasks required to obtain the values of the dependent variables as numerical functions of the independent variables, parameters and input sources. This task is achieved by computing numerical approximations of the model equations using finite differences techniques of arbitrary order, which are implemented in the solver numerical routines. Those approximations are used iteratively to numerically solve the model equations, and the sequence of those iterative approximations is referred to as the solving steps. It is important to note that, the numerical routines used to numerically solve the model equations are independent from the precise form of the model equations.
Control methods referred to as Model Reference Adaptive Control require the capability of updating the model parameters to achieve a pre-defined goal while operating the controlled system, such as minimizing the error between the model prediction and the actual response of the controlled system. This can be achieved by the model numerical solver through the use of a numerical optimizer which computes the optimal values of the model parameters with respect to a pre-defined goal. The numerical optimizer should guarantee that the computed optimal values of the parameters lie within the lower and upper bounds defined in the model description.
Mathematical models are used in various control applications ranging from mechatronics to industrial systems controls. These models are typically described by a set of non-linear Differential Algebraic Equations (DAE) for which an analytical solution either is not known or does not exist. Modern numerical techniques are extremely efficient for obtaining numerical solutions of such equations. For systems described by a set of Partial Differential Equations (PDE) spatial discretization schemes are employed to transform them into a set of DAEs.
Real time control methods require such models to be ported into an embedded processor and solved in “real time” relative to the time constants of the controlled process. Some advanced control methods such as Model Reference Adaptive Control (MRAC) also involve updating the parameters of the model in real time in order to minimize error or adapt to changes in the controlled system.
So far the process of model development/optimization and its embedded implementation has been a two-step process. First the model is developed and optimized in a general purpose Computer Aided Engineering (CAE) environment. After the model has been verified and optimized custom model code is generated either automatically or manually.
The two-step process has the following drawbacks:                1. The code produced does not contain all the functionality available in the CAE environment. For example the Embedded Coder of MATLAB™ does not provide essential numerical routines such as the DAE solver itself. The resulting software is compromised as it cannot benefit from features such as an efficient DAE solver or runtime sensitivity analysis which may be required in certain adaptive control applications. Other features that affect computational performance such as adaptive step-size are also not included.        2. Any change in the model itself requires repetition of the two-step process. If the code is produced manually it adds significantly to the cost of the system.        
Accordingly, a solution which minimizes or eliminates these current drawbacks for model development and its embedded implementation would be beneficial.